package spring.code;

import com.geektime.hello.entity.User;
import org.springframework.core.ResolvableType;


/**
 * @Author: DRevelation
 * @Date: 2020/12/31 10:29
 */
public class ResolvableTypeDemo {

    public static void main(String[] args) throws NoSuchFieldException {
        User user = new User();
        user.setUserId(1L);
        user.setUsername("haha");
        ResolvableType t = ResolvableType.forField(User.class.getDeclaredField("username"));
        ResolvableType t2 = ResolvableType.forClass(User.class);
        System.out.println(t.getType());
        System.out.println(t2.getType());
    }
}
